from fdfs_client.client import *
def save(content):
        conf=get_tracker_conf(r'E:\hansen\python\ihome_python\ihome\utils\client.txt')
        client=Fdfs_client(conf)
        res=client.upload_appender_by_buffer(content.read())
        if res.get('Status') !='Upload successed.':
            raise Exception("上传文件失败")
        filename=res.get("Remote file_id")
        print(filename)
        return filename.decode('utf8')

if __name__=="__main__":
    with open(r"D:\desktop\HOXI_818-LoveHouse-master\LoveHouse\static\images\home01.jpg",'rb') as f:
        save(f)